Function Reference

_DateIsValid

Checks the given date to determine if it is a valid date.

#include <Date.au3>
_DateIsValid ( $sDate )

 

Parameters

$sDate The date to be checked.

 

Return Value

Success: Returns 1.
Failure: Returns 0 if the specified date is not valid.

 

Remarks

This function takes a date input in one of the following formats:
    "yyyy/mm/dd[ hh:mm[:ss]]" or "yyyy/mm/dd[Thh:mm[:ss]]"
    "yyyy-mm-dd[ hh:mm[:ss]]" or "yyyy-mm-dd[Thh:mm[:ss]]"
    "yyyy.mm.dd[ hh:mm[:ss]]" or "yyyy.mm.dd[Thh:mm[:ss]]"

 

Related

None.

 

Example


#include <Date.au3>

$sDate =  @YEAR & "/" & @MON & "/" & @MDAY

If _DateIsValid( $sDate ) Then
  MsgBox( 4096, "Valid Date", "The specified date is valid." )
Else
  MsgBox( 4096, "Valid Date", "The specified date is invalid." )
EndIf